00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00053 define("PATH_TO_ROOT", "../");
00054
00055
00056 define("PICLENS_PAGE", "board.php");
00057
00059 require_once (PATH_TO_ROOT."common/init.inc.php");
00060 if (isset($_POST['Cancel'])) {
00061 header("Location: ".$_SERVER['PHP_SELF']);
00062 exit;
00063 }
00065 require_once (PATH_TO_ROOT."common/header.inc.php");
00066 include_once "header.inc.php";
00067 require_once (PATH_TO_ROOT . "user/classes/class.usertools.inc.php");
00068 writeContentHeader(Output::getIcon("icon_photogallery", "FotoForum") ."FotoForum");
00070 require_once (PATH_TO_ROOT."photogallery/admin/classes/class.gallerysettings.inc.php");
00071 $gSettings = new GallerySettings();
00073 include_once "./classes/class.header.inc.php";
00074 if (!isset($board['boardid']) || !$board['boardid'] || $board['boarddisabled']) {
00075 $forbidden = true;
00076 if ($board['boarddisabled']) {
00077 $prights = getAlbumRights($board['boardid']);
00078 $forbidden = !testPhotoRight($prights, 'admin');
00079 }
00080 if ($forbidden) errormessage("Fehler", "Board existiert nicht!");
00081 }
00082 if (!getAlbumRight('view', $board['boardid'])) {
00083 errormessage("Fehler", "Leider dürfen Sie dieses Album nicht betrachten.");
00084 }
00085 $TMain = new Template("templates/frame.html");
00086 $TTopics = new Template("templates/topics.html");
00087 $TTopicrow = new Template("templates/topicrow.html");
00088
00089 $subscribe = mysql_fetch_array(forum_query("SELECT subscribeid, boardid FROM forum_subscribe WHERE threadid = 0 AND boardid = $board[boardid] AND userID = $g_user[userID] "));
00090 $subscribeid = $subscribe['subscribeid'];
00091 if ($subscribeid != '') {
00092 $subscribe_mark = 'Album ist abonniert. ';
00093 $subscribe_mark.= '<strong><a href="'.build_link('../forum/editprofile.php#abo') .'" title="Mitteilungen verwalten">[ Verwaltung ]</a></strong>';
00094 $subscribe_mark.= ' | <strong><a href="'.build_link('misc.php?action=abbestellen&sthreadid=0&boardid='.$board['boardid'].'') .'" title="Abonnement abbestellen">[ abbestellen ]</a></strong>';
00095 } else {
00096 $subscribe_mark = '<a href="'.build_link('misc.php?action=bestellen&sthreadid=0&boardid='.$board['boardid'].'') .'" title="Per Mail benachrichtigen lassen"> <strong>Über neue Einträge per Email informieren! </strong></a>';
00097 }
00098
00099 if (!isset($pagenum)) {
00100 $pagenum = 1;
00101 }
00102 if (!empty($time)) {
00103 $lastvisited = $time;
00104 }
00105 if (!empty($lastvisited)) {
00106 $TIME_STRING = "&time=".intval($lastvisited);
00107 } else {
00108 $TIME_STRING = '';
00109 }
00110 $r_thread = forum_query("SELECT threadid, threadtopic, threadtime, threadauthor,
00111 threadreplies, threadclosed, threadtop, threadlastreplyby, threadiconid, threadlink,
00112 threadviews, ackpost, acklevel, userID FROM forum_thread WHERE
00113 boardid='".intval($board['boardid']) ."'
00114 ORDER BY threadtop DESC, threadtime DESC LIMIT
00115 ".intval(($pagenum-1) *$config['vars_t_amount']) .", $config[vars_t_amount]");
00116 $i = 0;
00117 $topicicon[0] = 'fullalpha';
00118 $TOPICROWS = '';
00119 if (mysql_num_rows($r_thread) < 1) {
00120 $TTopicrow = new Template('./templates/board_nothreads.html');
00121 eval($TTopicrow->GetTemplate("TOPICROWS"));
00122 }
00123 while ($thread = mysql_fetch_array($r_thread)) {
00124 global $db;
00125 $threadID = $thread['threadid'];
00126 $userID = $thread['userID'];
00127 $courseID = $_SESSION["course"];
00128
00129 $lastReplyBy = $db->get_var("SELECT userID FROM forum_post WHERE threadID = '$threadID' ORDER BY posttime DESC LIMIT 1");
00130 if ($lastReplyBy != null && $lastReplyBy > 0) {
00131 $groupName = UserTools::getUserGroupName($userID, $courseID);
00132 $replyAttr = " ($groupName)";
00133 }
00134
00135 $groupName = UserTools::getUserGroupName($userID, $courseID);
00136 $groupAttr = " ($groupName)";
00137 $author = $thread['threadauthor'] . $groupAttr;
00138 $thread['threadauthor'] = Data::toHTML($author, false);
00139 $thread['threadlastreplyby'] = Data::toHTML($thread['threadlastreplyby'], false);
00140 if ($thread['threadlink'] != 0) {
00141 if ($P->has_permission(P_OMOVE)) $prepend = 'Verschoben [<a href="'.build_link('threadops.php?action=remove_link&threadid='.$thread['threadid']) .'" title="Link entfernen">Link entf.</a>]: ';
00142 else $prepend = 'Verschoben: ';
00143 $thread['threadid'] = $thread['threadlink'];
00144 $thread['threadreplies'] = '-';
00145 $thread['threadviews'] = '-';
00146 $thread['threadtime'] = 0;
00147 $thread['threadlastreplyby'] = 'N/A';
00148 } elseif ($thread['threadtop']) {
00149 $prepend = 'Fest: ';
00150 } else {
00151 $prepend = '';
00152 }
00153
00154 $SQL = "SELECT sum(firstpost_value)/ count(*) AS MWert, count(*) AS Anz FROM forum_post WHERE threadid = '$thread[threadid]' AND firstpost_value>0";
00155 $res = $db->get_row($SQL);
00156
00157 $SQL2 = "SELECT threadrate FROM forum_thread WHERE threadid = '$thread[threadid]'";
00158 $res2 = $db->get_row($SQL2);
00159
00160 $result = number_format ($res->MWert,'1','.','');
00161 $rate = "";
00162
00163
00164 for($i=0;$i<floor($result);$i++)
00165 {
00166 $rate= $rate . "<img src='templates/images/star11.gif' title='". $result ." / 5.0'/>";
00167
00168 }
00169 for($i=0;$i<ceil($result)-floor($result);$i++)
00170 {
00171 $rate= $rate . "<img src='templates/images/star22.gif' title='". $result ." / 5.0'/>";
00172
00173 }
00174 for($i=0;$i<5-ceil($result);$i++)
00175 {
00176 $rate= $rate . "<img src='templates/images/star00.gif' />";
00177
00178 }
00179 if($res2->threadrate==0)
00180 {
00181 $rate= $rate . " <br /> <span title='Keine Bewertung gewünscht'>---</span>";
00182 }
00183 else
00184 {
00185
00186 $rate.="<br/> ". $result ." / 5.0 (".$res->Anz.")";
00187 }
00188
00189
00190 if ($thread['threadtime'] > $lastvisited && $lastvisited != 0) {
00191 $imagepath = PATH_TO_ROOT.'forum/templates/images/icon/'.$topicicon[($thread['threadiconid']) ].'_new.png';
00192 } else {
00193 $imagepath = PATH_TO_ROOT.'forum/templates/images/icon/'.$topicicon[($thread['threadiconid']) ].'.png';
00194 }
00195 $thread['threadtopic'] = Data::toHTML($thread['threadtopic'], false);
00196 $thread['threadtime'] = form_date($thread['threadtime']);
00197
00198 $r_subscribe = forum_query("SELECT subscribeid FROM forum_subscribe WHERE (threadid = $thread[threadid] AND userID = $g_user[userID]) OR (threadid = 0 AND boardid = '".intval($board['boardid']) ."' AND userID = $g_user[userID])");
00199 if (mysql_num_rows($r_subscribe)) {
00200 $subscribe_note = '<img src="'.PATH_TO_ROOT.'forum/templates/images/bestellt.gif" alt="abonniert" title="Sie haben dieses Thema abonniert" />';
00201 } else {
00202 $subscribe_note = '';
00203 }
00204
00205 $npages = ceil(($thread['threadreplies']+1) /$config['vars_m_amount']);
00206 $pages = '';
00207 if ($npages > 1) {
00208 for ($j = 0 ; $j < $npages ; $j++) {
00209 $pages.= '<a href="'.build_link('showtopic.php?threadid='.$thread['threadid'].'&pagenum='.($j+1) .$TIME_STRING) .'" title="Thema anzeigen">'.($j+1) .'</a> ';
00210 if ($j == 2 && $npages > 6) {
00211 $pages.= '... ';
00212 $j = $npages-4;
00213 }
00214 }
00215 $pages = '(Seiten: '.$pages.')';
00216 }
00217 if ($thread['threadclosed'] == 1) $imagepath = PATH_TO_ROOT."forum/templates/images/information_closed.png";
00218
00219 $postpic = $db->get_row("SELECT postfilename, postfilesavename FROM forum_post WHERE threadid=".$thread['threadid']);
00220 if ($postpic) {
00221 $ext = '&ext='.strrchr($postpic->postfilename, '.');
00222 $picPath = PATH_TO_ROOT.$settings["upload_path"].'forum/course/'.$_SESSION['course'].'/board/'.$board['boardid'].'/'.$postpic->postfilesavename;
00223 $maxW = "&maxw=150";
00224 $maxH = "&maxh=112";
00225 $thread['thumbnail'] = "<img src='".PATH_TO_ROOT."common/makethumb.php?picurl=".rawurlencode($picPath) .$maxW.$maxH.$ext."' alt='Thumbnail' style='margin-right: 10px; border: 1px solid #000000;' />";
00226 }
00227 eval($TTopicrow->GetTemplate("TOPICROWS"));
00228 $i++;
00229 }
00230
00231 if ($board['boardthreads'] > 0) $slideshow_link = " | <a href='slideshow.php?album=$board[boardid]'><strong>Slideshow</strong></a> | <a href='javascript:PicLensLite.start();'> <img src='http://lite.piclens.com/images/PicLensButton.png' alt='PicLens' width='16' height='12' border='0' align='absmiddle'><strong> Start PicLens-Slideshow </strong></a>";
00232
00233 else $slideshow_link = "";
00234 $topic_pages = ceil($board['boardthreads']/$config['vars_t_amount']);
00235
00236 define('PADDING', 3);
00237 $pages_nav = '';
00238
00239 if ($pagenum-PADDING > 1) {
00240 $pages_nav = '[<a class="bglink" href="'.build_link('board.php?boardid='.$board['boardid'].'&pagenum=1') .'" title="Zur ersten Seite gehen">Erste Seite</a>] ... ';
00241 }
00242
00243 $i = $pagenum-PADDING;
00244 if ($i < 1) $i = 1;
00245 $imax = $pagenum+PADDING;
00246 if ($imax > $topic_pages) $imax = $topic_pages;
00247 for ($i ; $i <= $imax ; $i++) {
00248 if ($i == $pagenum) $pages_nav.= '<strong>-'.$i.'-</strong> ';
00249 else $pages_nav.= '[<a class="bglink" href="'.build_link('board.php?boardid='.$board['boardid'].'&pagenum='.$i) .'" title="Zur '.$i.'. Seite gehen">'.$i.'</a>] ';
00250 }
00251
00252 if ($pagenum+PADDING < $topic_pages) {
00253 $pages_nav.= '... [<a class="bglink" href="'.build_link('board.php?boardid='.$board['boardid'].'&pagenum='.$topic_pages) .'" title="Zur letzten Seite gehen">Letzte Seite</a>]';
00254 }
00255 if ($g_user['userID'] != 0) {
00256 $options_newthread = '<a href="'.build_link('newtopic.php?boardid='.$board['boardid']) .'" title="Neues Thema erstellen">Neues Thema</a> |';
00257 }
00258 if ($P->has_permission(P_POSTNEW)) {
00259 $canpostnew = 'Ja';
00260 } else {
00261 $canpostnew = 'Nein';
00262 }
00263 if ($P->has_permission(P_REPLY)) {
00264 $canreply = 'Ja';
00265 } else {
00266 $canreply = 'Nein';
00267 }
00268 $JUMP_MENU = jumpmenu($board['boardid']);
00269 $navpath.= 'Bilderübersicht';
00270 $titleprepend = $board['boardname'].' - ';
00271 eval($TTopics->GetTemplate("CONTENT"));
00272 eval($TMain->GetTemplate());
00273 include_once "footer.inc.php";
00275 require_once (PATH_TO_ROOT."common/footer.inc.php");